import { ref, unref } from 'vue';
import { defineStore } from 'pinia';

export const useHomeIndexStore = defineStore('homeIndex', () => {
  const currentIndex = ref(0);

  const setIndex = (num: number): void => {
    currentIndex.value = num;
  };

  const getCurrentIndex = (): number => {
    return unref(currentIndex);
  };

  return { currentIndex, setIndex, getCurrentIndex };
});
